<?php 
$conn = mysql_connect('localhost', 'opencart_user', 'Loveourwork888');
mysql_select_db('daigou', $conn);
$sql1="SELECT * FROM  `dg_sysconfig` where varname='sft_urls'";
$resultx=mysql_query($sql1);
$roes=mysql_fetch_array($resultx);

$sql2="SELECT * FROM  `dg_sysconfig` where varname='chongzhi'";
$result2=mysql_query($sql2);
$roe2=mysql_fetch_array($result2);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[{$cfg_site_name}] - {lang The_largest_Shopping_Website}</title>
<meta name="keywords" content="{$cfg_site_keywords}" />
<meta name="description" content="{$cfg_site_description}" />
<!--<link rel="stylesheet" type="text/css" href="css/layout.css">-->

<link type="text/css" rel="stylesheet" href="{TPL}css/NewTopFoot.css"  />
<link type="text/css" rel="stylesheet" href="{TPL}css/ShoppingCart.css"/>
<link href="{TPL}css/public.css" rel="stylesheet" type="text/css" />
<link href="{TPL}css/buy.css" rel="stylesheet" type="text/css" />

</head>
<body>
{template 'header'}

<link href="{TPL}newedit/css/public.css" rel="stylesheet" type="text/css" />
<link href="{TPL}newedit/css/index.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="{TPL}newedit/js/jquery-1.11.1.min.js"></script>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="http://cdn.rawgit.com/hilios/jQuery.countdown/2.0.4/dist/jquery.countdown.min.js"></script>

    <style type="text/css">
        .item {
            width: 100px;
            height: 100px;
        }
        .buy {
            display: none;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function(){
			$(".btnclick").click(function(){
			   $('.list .item').each(function(i, e){
                $(e).countdown($(e).data('time'), function(event){
                    if(event.type=='update'){
                        $(this).find('.countdown').html(event.strftime('%H:%M:%S'));
                    }else if(event.type=='finish'){ 
                        $(this).find('.countdown').html('已经到期');
                        $(this).find('.buy').show();
                    }
                })
                .on('finish', function(){
                });
            });
			});
		});
    </script>	
	
<script language="javascript" type="text/javascript">   
    $(document).ready(function(){		

        $(".d_daigou").click(function(){
            $(".jiantou").show();
			$("#CrawlUrl").focus();
        });
        $(".jiantou a").click(function(){
            $(this).parents(".jiantou").hide();
            return false;
        });		

		$("#shangchang").click(function(){
            alert ("敬请期待");
        });
		
		
	});
	
	
</script>

<script type='text/javascript'>

function checkArea(name,obj)
{
	document.getElementById('areali1').removeAttribute("class");
	document.getElementById('areali2').removeAttribute("class");
	document.getElementById('hdArea').value = name;
	obj.setAttribute("class","b_c_tit_hover");
	
	var selectedCatText = document.getElementById('hdCat').value;
	var selectedAreaText = name;
 
		$.get('subItem.php?hfArea=' + selectedAreaText + '&hfCategory=' + selectedCatText, function(data) {
			$("#sub_cat").html(data);
			$('.list .item').each(function(i, e){
                $(e).countdown($(e).data('time'), function(event){
                    if(event.type=='update'){
                        $(this).find('.countdown').html(event.strftime('%D天 %H时%M分%S秒'));
                    }else if(event.type=='finish'){ 
                        $(this).find('.countdown').html('已经到期');
                        $(this).find('.buy').show();
                    }
                })
                .on('finish', function(){
                });
            });			
		});
	
    return false;
}

function clickCategory(name,obj)
{
	document.getElementById('catdl1').removeAttribute("class");
	document.getElementById('catdl2').removeAttribute("class");
	document.getElementById('catdl3').removeAttribute("class");
	document.getElementById('catdl4').removeAttribute("class");
	document.getElementById('hdCat').value = name;
	obj.setAttribute("class","b_bo_hover");
	var selectedCatText = name;
	var selectedAreaText = document.getElementById('hdArea').value;
        
		
		$.get('subItem.php?hfArea=' + selectedAreaText + '&hfCategory=' + selectedCatText, function(data) {
			$("#sub_cat").html(data);
			$('.list .item').each(function(i, e){
                $(e).countdown($(e).data('time'), function(event){
                    if(event.type=='update'){
                        $(this).find('.countdown').html(event.strftime('%D天 %H时%M分%S秒'));
                    }else if(event.type=='finish'){ 
                        $(this).find('.countdown').html('已经到期');
                        $(this).find('.buy').show();
                    }
                })
                .on('finish', function(){
                });
            });			
		});

    return false;
}

</script>

<script type="text/javascript">
  
		function addToCart(cwname,cwprice,cwqty){
			var productName=cwname;
			var productUrl="cangwei.php?cat=" + document.getElementById('hdCat').value + "&area=" + document.getElementById('hdArea').value;
			var Picture="images/cangwei.png";
			var ShopName="-";
			var ShopHref="-";
			var price=cwprice;
			var productNum="1";
			var productSendPrice="0";
			var productsize=cwqty;
			var isAuction="0";
			var chicun="0";
			var yanse="-";
			var type="1";
			var expressno="";
			var VIPPrice1="-1",VIPPrice2="-1",VIPPrice3="-1";
			var productRemark="舱位: " + cwname;
			var category = document.getElementById('hdCat').value;
			var area = document.getElementById('hdArea').value;
			
			$.ajax({
                    type: "POST",
                    url: "/ajax/fast_ajax.php?action=addcangwei",
                    dataType: "json",
                    //contentType: "application/json;utf-8",
        
					data:"adddata="+encodeURIComponent("{\"name\":'" + productName + "',\"href\":'" + productUrl + "',\"picture\":'" + Picture + "',\"thumbnail\":'" + Picture + "',\"chicun\":'" + chicun + "',\"yanse\":'" + yanse + "',\"shopName\":'" + ShopName + "',\"shopHref\":'" + ShopHref + "',\"price\":'" + price + "',\"vipPrice1\":'" + VIPPrice1 + "',\"vipPrice2\":'" + VIPPrice2 + "',\"vipPrice3\":'" + VIPPrice3 + "',\"buyNum\":'" + productNum + "',\"freight\":'" + productSendPrice + "',\"isAuction\":'" + isAuction + "',\"remark\":'" + productRemark  + "',\"type\":'" + type  + "',\"expressno\":'" + expressno + "',\"buytype\":'" + category + "',\"buyarea\":'" + area + "',\"size\":'" + productsize + "'}"),

                   timeout: 10000,
				   error: function (){ alert(1) },
				   success: function (data){
					location.href="/shoppingcart.php";
				   }
                });
		
		}
		
    </script>
	
<!--banner-->
<form method="POST" >
<body onload="onloadFunction()">
<div class="box">
	<div class="box_998_cent m_t_20">
	<div class="buy_cont">
    	<div class="b_c_tit">
        	<ul>
            	<li>地区：</li>
            	<li><a id="areali1" href="#" onclick='return checkArea("西马",this)'>西马</a></li>
            	<li><a id="areali2" href="#" onclick='return checkArea("东马",this)'>东马</a></li>
				
				<input type="hidden" value="" name="hdArea" id="hdArea">
				
            </ul>
        </div>
		<div class="buy_03_tit"><i>1</i>选择运输种类</div>
        <div class="buy_02">
        	<dl id="catdl1" onclick="clickCategory('普通空运',this)"><dt>普通空运</dt><dd>衣服，鞋子，包包，母婴用品，首饰等</dd></dl>
        	<dl id="catdl2" onclick="clickCategory('敏感空运',this)"><dt>敏感空运</dt><dd>电池，手表，电子，化妆品，家电</dd></dl>
        	<dl id="catdl3" onclick="clickCategory('专线空运',this)"><dt>专线空运  </dt><dd>包税 产品遗失获赔100%赔偿，最高达到5000元</dd></dl>
        	<dl id="catdl4" onclick="clickCategory('海运',this)"><dt>海运 </dt><dd>最低0.1立方米，也提供整柜报关服务</dd></dl>
			<input type="hidden" value="" name="hdCat" id="hdCat">
            <div class="clear"></div>
        </div>
        <div class="buy_03_tit"><i>2</i>选择容量</div>
       
			
			<div id="sub_cat" class="buy_04"  name="sub_cat">
                                                     
            </div>
			
		<div class="clear"></div>
        <!--<div class="but_next"><input type="button" class="next_01" value="下一步" /></div>-->
    </div>
    
</div>
</div>
<script type="text/javascript" charset="utf-8">
function onloadFunction() {
	var getcat = decodeURIComponent(getUrlParameter('cat'));
	var getarea = decodeURIComponent(getUrlParameter('area'));
	var getrefcat = "catdl1";
	var getrefarea = "areali1";
	
	if (getcat == "" || getarea == "")
	{
		getcat = "普通空运";
		getarea = "西马";
		document.getElementById('hdArea').value = getarea;
		document.getElementById('areali1').setAttribute("class","b_c_tit_hover");
		clickCategory(getcat,document.getElementById(getrefcat));
	}
	else
	{
		if(getcat == "普通空运")
		{
		 getrefcat = "catdl1";
		}
		else if (getcat == "敏感空运")
		{
		 getrefcat = "catdl2";
		}
		else if (getcat == "专线空运")
		{
		 getrefcat = "catdl3";
		}
		else if (getcat == "海运")
		{
		 getrefcat = "catdl4";
		}
		
		if(getarea == "西马")
		{
			document.getElementById('hdArea').value = getarea;
			document.getElementById('areali1').setAttribute("class","b_c_tit_hover");
		}
		else if(getarea == "东马")
		{
			document.getElementById('hdArea').value = getarea;
			document.getElementById('areali2').setAttribute("class","b_c_tit_hover");
		}
		
		clickCategory(getcat,document.getElementById(getrefcat));
	}
}

function getUrlParameter(sParam)
{
    var sPageURL = window.location.search.substring(1);
    var sURLVariables = sPageURL.split('&');
    for (var i = 0; i < sURLVariables.length; i++) 
    {
        var sParameterName = sURLVariables[i].split('=');
        if (sParameterName[0] == sParam) 
        {
            return sParameterName[1];
        }
    }
	return "";
}  
</script>
</body>
</form>


<div class="clear"></div>
<!--end box-->

{template 'footer'}
<script type="text/javascript" src="{TPL}js/indexSlide.js"></script>
<script type="text/javascript">
    $(function() {
        var e = function(n, b) {
            if (n.length > b) {
                return n.substring(0, b - 2) + "...";
            }
            return n;
        };		
		
        $.getJSON("/ajax/index_ajax.php?action=maqueeproduct&r=" + Math.random(),
        function(n) {
            var b = $("<ul></ul>");
            $("#Slider").empty().append(b);
            $.each(n,
            function(o, p) {
                b.append('<li><div class="detailed"><div class="pic"><a href="{url_see.php?type=}' + p.c + "#" + p.id + '"><img width=80 height=80 alt="' + p.n + '" src="' + p.p + '" /></a></div><div class="info"><h2><a href="{url_see.php?type=}' + p.c + "#" + p.id + '">' + e(p.n, 40) + "</a></h2><dl><dd><b>￥" + p.m + "</b><span>" + p.d + '</span></dd><dd class="i_bj">{lang Purchasing_information}：' + p.un + "{lang buywith}" + p.s + '</dd></dl></div></div><div class="concise"><p><a href="{url_see.php?type=}' + p.c + "#" + p.id + '">' + e(p.n, 25) + "</a></p><span>" + p.d + "</span></div></li>");
            }); (function(v, x) {
                var w = true;
                var u = b;
                var o = 0;
                var p;
                var t = 1;
                var y = u.find(".concise:eq(0)").outerHeight();
                u.scrollTop(0);
                u.children().each(function() {
                    o += $(this).outerHeight();
                });
                u.append(u.html());
                var q = u.find("li:eq(1)");
                $(q).find(".detailed").show();
                $(q).find(".concise").hide();
                var z = function() {
                    var s = u.scrollTop();
                    if (s >= o) {
                        q = u.find("li:eq(0)");
                        u.find(".detailed").hide();
                        $(q).find(".detailed").show();
                        $(q).find(".concise").hide();
                    }
                    u.scrollTop((s >= o ? 0 : s) + t);
                    if (u.scrollTop() % y == 0) {
                        r();
                    }
                };
                function r() {
                    t = 0;
                    if (w) {
                        setTimeout(function() {
                            $(q).find(".concise").show();
                            q = $(q).next("li:first");
                            if (!q) {
                                q = u.find("li:first");
                            }
                            u.find(".detailed").hide();
                            $(q).find(".detailed").show();
                            $(q).find(".concise").hide();
                            w = true;
                            t = 1;
                        },
                        x);
                    }
                    w = false;
                }
                u.find("li").mouseover(function() {
                    u.find(".detailed").hide();
                    $(this).find(".detailed").show();
                    $(this).find(".concise").hide();
                    clearInterval(p);
                });
                u.find("li").mouseout(function() {
                    u.find(".detailed").hide();
                    $(this).find(".concise").show();
                    $(q).find(".detailed").show();
                    $(q).find(".concise").hide();
                    p = setInterval(z, v);
                });
                p = setInterval(z, v);
            })(30, 3000);
        });
    });
</script></div>
</body>
</html>
